home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 4 / The Arsenal Files 4 (Arsenal Computer).ISO / clarion / disabl.exe / CONTA006.CLW < prev    next >
Text File  |  1995-01-04  |  19KB  |  547 lines

  1.                      MEMBER('CONTACTS.clw')       ! This is a MEMBER module
  2. BrowseByDate PROCEDURE
  3.  
  4. LocalRequest         LONG,AUTO
  5. OriginalRequest      LONG,AUTO
  6. LocalResponse        LONG,AUTO
  7. WindowOpened         LONG
  8. WindowInitialized    LONG
  9. ForceRefresh         LONG,AUTO
  10. RecordFiltered       LONG
  11. Queue:Browse         QUEUE                        ! Browsing Queue
  12. Brw1::CON:DateLead     LIKE(CON:DateLead)         ! Queue Display field
  13. Brw1::CON:LastName     LIKE(CON:LastName)         ! Queue Display field
  14. Brw1::CON:FirstName    LIKE(CON:FirstName)        ! Queue Display field
  15. Brw1::CON:Company      LIKE(CON:Company)          ! Queue Display field
  16. Brw1::CON:Address1     LIKE(CON:Address1)         ! Queue Display field
  17. Brw1::CON:Address2     LIKE(CON:Address2)         ! Queue Display field
  18. Brw1::CON:City         LIKE(CON:City)             ! Queue Display field
  19. Brw1::CON:State        LIKE(CON:State)            ! Queue Display field
  20. Brw1::CON:Zip          LIKE(CON:Zip)              ! Queue Display field
  21. Brw1::CON:Phone        LIKE(CON:Phone)            ! Queue Display field
  22. Brw1::CON:Fax          LIKE(CON:Fax)              ! Queue Display field
  23. Brw1::CON:JobTitle     LIKE(CON:JobTitle)         ! Queue Display field
  24. Brw1::CON:Interest     LIKE(CON:Interest)         ! Queue Display field
  25. Brw1::CON:TimeFrame    LIKE(CON:TimeFrame)        ! Queue Display field
  26. Brw1::CON:CurrentSoftware LIKE(CON:CurrentSoftware) ! Queue Display field
  27. Brw1::CON:Remarks      LIKE(CON:Remarks)          ! Queue Display field
  28. Brw1::Position         STRING(255)                ! Queue POSITION information
  29.                      END                          ! END (Browsing Queue)
  30. Brw1::RecordStatus   BYTE                         ! Flag for Range/Filter test
  31. Brw1::ItemsToFill    LONG                         ! Controls records retrieved
  32. Brw1::MaxItemsInList LONG                         ! Retrieved after window opened
  33. Brw1::LocatedPosition STRING(255)                 ! POSITION of located record
  34. Brw1::QueuePointer   LONG                         ! Queue position of located record
  35. Brw1::NextChoice     LONG                         ! Queue position of located record
  36. Brw1::CurrentScroll  BYTE                         ! Queue position of scroll thumb
  37. BrowseDateWindow     WINDOW('Browse by Date'),AT(46,40,289,129),FONT('Arial',10,,),SYSTEM,GRAY,MDI
  38.                        LIST,AT(5,5,279,100),MSG('Browsing Records'),USE(?List),IMM,HVSCROLL,FORMAT('48L~Date of Lead~@p##/##/##p@83L~Last Name~@s20@80L~First Name~@s20@80L~Company~' &|
  39.    '@s25@80L~Address 1~@s25@80L~Address 2~@s25@80L~City~@s25@80L~State~@s2@80L~Zip~@' &|
  40.    's5@80L~Phone~@p(###) ###-####p@80L~Fax~@p(###) ###-####p@80L~Job Title~@s25@80L~' &|
  41.    'Interest~@s45@80L~Time Frame~@s15@80L~Current Software~@s25@80L~Remarks~@s45@'),FROM(Queue:Browse)
  42.                        BUTTON('&Insert'),AT(5,110,45,12),USE(?Insert)
  43.                        BUTTON('&Change'),AT(50,110,45,12),USE(?Change),DEFAULT
  44.                        BUTTON('&Delete'),AT(95,110,45,12),USE(?Delete)
  45.                        BUTTON('&Select'),AT(145,110,40,12),USE(?Select)
  46.                        BUTTON('Close'),AT(200,110,40,12),USE(?Close)
  47.                      END
  48.   CODE
  49.   LocalRequest = GlobalRequest
  50.   OriginalRequest = GlobalRequest
  51.   LocalResponse = RequestCancelled
  52.   CLEAR(GlobalRequest)
  53.   CLEAR(GlobalResponse)
  54.   IF contacts::Used = 0
  55.     CheckOpen(contacts,1)
  56.   END
  57.   contacts::Used += 1
  58.   OPEN(BrowseDateWindow)
  59.   WindowOpened=True
  60.   SET(CON:Date_Lead_Received)
  61.   ?List{Prop:Alrt,251} = MouseLeft2
  62.   IF LocalRequest = SelectRecord
  63.     ENABLE(?Select)
  64.     ?Select{Prop:Default} = True
  65.   ELSE
  66.     DISABLE(?Select)
  67.   END
  68.   ?List{Prop:Alrt,255} = InsertKey
  69.   ?List{Prop:Alrt,254} = DeleteKey
  70.   ?List{Prop:Alrt,253} = CtrlEnter
  71.   ACCEPT
  72.     CASE EVENT()
  73.     OF EVENT:OpenWindow
  74.       IF NOT WindowInitialized
  75.         DO InitializeWindow
  76.       END
  77.       SELECT(?List)
  78.     OF EVENT:GainFocus
  79.       WindowInitialized = True
  80.       DO InitializeWindow
  81.     END
  82.     CASE FIELD()
  83.     OF ?List
  84.       CASE EVENT()
  85.       OF EVENT:Accepted
  86.         DO Brw1::FillBuffer
  87.         DO RefreshWindow
  88.       OF EVENT:NewSelection
  89.         DO Brw1::FillBuffer
  90.         DO RefreshWindow
  91.       OF EVENT:ScrollUp
  92.         DO Brw1::ScrollUp
  93.         DO RefreshWindow
  94.       OF EVENT:ScrollDown
  95.         DO Brw1::ScrollDown
  96.         DO RefreshWindow
  97.       OF EVENT:PageUp
  98.         DO Brw1::PageUp
  99.         DO RefreshWindow
  100.       OF EVENT:PageDown
  101.         DO Brw1::PageDown
  102.         DO RefreshWindow
  103.       OF EVENT:ScrollTop
  104.         DO Brw1::ScrollTop
  105.         DO RefreshWindow
  106.       OF EVENT:ScrollBottom
  107.         DO Brw1::ScrollBottom
  108.         DO RefreshWindow
  109.       OF EVENT:AlertKey
  110.         DO Brw1::AlertKey
  111.         DO RefreshWindow
  112.       END
  113.     OF ?Insert
  114.       CASE EVENT()
  115.       OF EVENT:Accepted
  116.         DO SyncWindow
  117.         DO Brw1::ButtonInsert
  118.         DO RefreshWindow
  119.       END
  120.     OF ?Change
  121.       CASE EVENT()
  122.       OF EVENT:Accepted
  123.         DO SyncWindow
  124.         DO Brw1::ButtonChange
  125.         DO RefreshWindow
  126.       END
  127.     OF ?Delete
  128.       CASE EVENT()
  129.       OF EVENT:Accepted
  130.         DO SyncWindow
  131.         DO Brw1::ButtonDelete
  132.         DO RefreshWindow
  133.       END
  134.     OF ?Select
  135.       CASE EVENT()
  136.       OF EVENT:Accepted
  137.         DO SyncWindow
  138.         LocalResponse = RequestCompleted
  139.         POST(Event:CloseWindow)
  140.         CYCLE
  141.         DO RefreshWindow
  142.       END
  143.     OF ?Close
  144.       CASE EVENT()
  145.       OF EVENT:Accepted
  146.         DO SyncWindow
  147.         LocalResponse = RequestCancelled
  148.         POST(Event:CloseWindow)
  149.         DO RefreshWindow
  150.       END
  151.     END
  152.   END
  153.   contacts::Used -= 1
  154.   IF contacts::Used = 0 THEN CLOSE(contacts).
  155.   IF WindowOpened
  156.     CLOSE(BrowseDateWindow)
  157.   END
  158.   IF LocalResponse
  159.     GlobalResponse = LocalResponse
  160.   ELSE
  161.     GlobalResponse = RequestCancelled
  162.   END
  163.   RETURN
  164. !---------------------------------------------------------------------------
  165. InitializeWindow ROUTINE
  166.   DO Brw1::OpenWindow
  167.   ForceRefresh = True
  168.   DO RefreshWindow
  169. !---------------------------------------------------------------------------
  170. RefreshWindow ROUTINE
  171.   IF ForceRefresh
  172.     GET(Queue:Browse,CHOICE(?List))
  173.     REGET(CON:Date_Lead_Received,Brw1::Position)
  174.     DO Brw1::ValidateRecord
  175.     IF Brw1::RecordStatus <> Record:OK
  176.       FREE(Queue:Browse)
  177.       SET(CON:Date_Lead_Received)
  178.       DO Brw1::RefreshPage
  179.     ELSE
  180.       DO Brw1::LocateRecord
  181.     END
  182.   ELSE
  183.     DO Brw1::ValidateRecord
  184.     IF Brw1::RecordStatus <> Record:OK
  185.       FREE(Queue:Browse)
  186.       SET(CON:Date_Lead_Received)
  187.       DO Brw1::RefreshPage
  188.     END
  189.   END
  190.   ?List{Prop:VScrollPos} = Brw1::CurrentScroll
  191.   DISPLAY()
  192.   ForceRefresh = False
  193. !---------------------------------------------------------------------------
  194. SyncWindow ROUTINE
  195.   IF RECORDS(Queue:Browse)
  196.     GET(Queue:Browse,CHOICE(?List))
  197.     REGET(CON:Date_Lead_Received,Brw1::Position)
  198.   END
  199. !---------------------------------------------------------------------------
  200. Brw1::OpenWindow ROUTINE
  201.   IF LocalRequest = SelectRecord
  202.     SET(CON:Date_Lead_Received,CON:Date_Lead_Received)
  203.     DO Brw1::LocateRecord
  204.   ELSE
  205.     SET(CON:Date_Lead_Received)
  206.     DO Brw1::RefreshPage
  207.     SELECT(?List,1)
  208.   END
  209.   DO Brw1::FillBuffer
  210. !----------------------------------------------------------------------
  211. Brw1::FillBuffer ROUTINE
  212.   GET(Queue:Browse,CHOICE(?List))
  213.   CON:DateLead = Brw1::CON:DateLead
  214.   CON:LastName = Brw1::CON:LastName
  215.   CON:FirstName = Brw1::CON:FirstName
  216.   CON:Company = Brw1::CON:Company
  217.   CON:Address1 = Brw1::CON:Address1
  218.   CON:Address2 = Brw1::CON:Address2
  219.   CON:City = Brw1::CON:City
  220.   CON:State = Brw1::CON:State
  221.   CON:Zip = Brw1::CON:Zip
  222.   CON:Phone = Brw1::CON:Phone
  223.   CON:Fax = Brw1::CON:Fax
  224.   CON:JobTitle = Brw1::CON:JobTitle
  225.   CON:Interest = Brw1::CON:Interest
  226.   CON:TimeFrame = Brw1::CON:TimeFrame
  227.   CON:CurrentSoftware = Brw1::CON:CurrentSoftware
  228.   CON:Remarks = Brw1::CON:Remarks
  229. !----------------------------------------------------------------------
  230. Brw1::FillQueue ROUTINE
  231.   Brw1::CON:DateLead = CON:DateLead
  232.   Brw1::CON:LastName = CON:LastName
  233.   Brw1::CON:FirstName = CON:FirstName
  234.   Brw1::CON:Company = CON:Company
  235.   Brw1::CON:Address1 = CON:Address1
  236.   Brw1::CON:Address2 = CON:Address2
  237.   Brw1::CON:City = CON:City
  238.   Brw1::CON:State = CON:State
  239.   Brw1::CON:Zip = CON:Zip
  240.   Brw1::CON:Phone = CON:Phone
  241.   Brw1::CON:Fax = CON:Fax
  242.   Brw1::CON:JobTitle = CON:JobTitle
  243.   Brw1::CON:Interest = CON:Interest
  244.   Brw1::CON:TimeFrame = CON:TimeFrame
  245.   Brw1::CON:CurrentSoftware = CON:CurrentSoftware
  246.   Brw1::CON:Remarks = CON:Remarks
  247.   Brw1::Position = POSITION(CON:Date_Lead_Received)
  248. !----------------------------------------------------------------------
  249. Brw1::ScrollUp ROUTINE
  250.   IF CHOICE(?List)>1
  251.     SELECT(?List, CHOICE(?List)-1)
  252.     POST(Event:NewSelection,?List)
  253.   ELSE
  254.     GET(Queue:Browse,1)                           ! Get the first queue item
  255.     RESET(CON:Date_Lead_Received,Brw1::Position)  ! Reset for sequential processing
  256.     NOMEMO(contacts)
  257.     PREVIOUS(contacts)                            ! Retrieve record, reverse access
  258.     Brw1::ItemsToFill = 1                         ! Load a single item
  259.     DO Brw1::FillBackward                         ! Fill with previous read(s)
  260.     IF Brw1::ItemsToFill                          ! If Load failed
  261.       Brw1::CurrentScroll = 0                     ! Move Thumb to top
  262.     ELSE
  263.       Brw1::CurrentScroll = 50                    ! Move Thumb to center
  264.     END
  265.   END
  266. !----------------------------------------------------------------------
  267. Brw1::ScrollDown ROUTINE
  268.   IF CHOICE(?List)<RECORDS(Queue:Browse)
  269.     SELECT(?List, CHOICE(?List)+1)
  270.     POST(Event:NewSelection,?List)
  271.   ELSE
  272.     GET(Queue:Browse,RECORDS(Queue:Browse))       ! Get the last queue item
  273.     RESET(CON:Date_Lead_Received,Brw1::Position)  ! Reset for sequential processing
  274.     NOMEMO(contacts)
  275.     NEXT(contacts)                                ! Retrieve record, forward access
  276.     Brw1::ItemsToFill = 1                         ! load a single item
  277.     DO Brw1::FillForward                          ! Fill with next read(s)
  278.     IF Brw1::ItemsToFill                          ! If Load failed
  279.       Brw1::CurrentScroll = 100                   ! Move Thumb to top
  280.     ELSE
  281.       Brw1::CurrentScroll = 50                    ! Move Thumb to center
  282.     END
  283.   END
  284. !----------------------------------------------------------------------
  285. Brw1::PageUp ROUTINE
  286.   GET(Queue:Browse,1)                             ! Get the first queue item
  287.   RESET(CON:Date_Lead_Received,Brw1::Position)    ! Reset for sequential processing
  288.   NOMEMO(contacts)
  289.   PREVIOUS(contacts)                              ! Retrieve record, reverse access
  290.   Brw1::ItemsToFill = ?List{Prop:Items}           ! Load a full page
  291.   DO Brw1::FillBackward                           ! Fill with previous read(s)
  292.   IF Brw1::ItemsToFill
  293.     Brw1::NextChoice = CHOICE(?List)-Brw1::ItemsToFill
  294.     IF Brw1::NextChoice < 1
  295.       Brw1::NextChoice = 1
  296.     END
  297.     SELECT(?List, Brw1::NextChoice)
  298.     Brw1::CurrentScroll = 0                       ! Move Thumb to top
  299.   ELSE
  300.     Brw1::CurrentScroll = 50                      ! Move Thumb to center
  301.   END
  302. !----------------------------------------------------------------------
  303. Brw1::PageDown ROUTINE
  304.   GET(Queue:Browse,RECORDS(Queue:Browse))         ! Get the last queue item
  305.   RESET(CON:Date_Lead_Received,Brw1::Position)    ! Reset for sequential processing
  306.   NOMEMO(contacts)
  307.   NEXT(contacts)                                  ! Retrieve record, forward access
  308.   Brw1::ItemsToFill = ?List{Prop:Items}           ! Load a full page
  309.   DO Brw1::FillForward                            ! Fill with next read(s)
  310.   IF Brw1::ItemsToFill
  311.     Brw1::NextChoice = CHOICE(?List)+Brw1::ItemsToFill
  312.     IF Brw1::NextChoice > RECORDS(Queue:Browse)
  313.       Brw1::NextChoice = RECORDS(Queue:Browse)
  314.     END
  315.     SELECT(?List, Brw1::NextChoice)
  316.     Brw1::CurrentScroll = 100                     ! Move Thumb to top
  317.   ELSE
  318.     Brw1::CurrentScroll = 50                      ! Move Thumb to center
  319.   END
  320. !----------------------------------------------------------------------
  321. Brw1::ScrollTop ROUTINE
  322.   FREE(Queue:Browse)                              ! Free the browse queue
  323.   SET(CON:Date_Lead_Received)
  324.   DO Brw1::RefreshPage
  325.   SELECT(?List,1)                                 ! Select first list item
  326.   Brw1::CurrentScroll = 0
  327. !----------------------------------------------------------------------
  328. Brw1::ScrollBottom ROUTINE
  329.   SETCURSOR(Cursor:Wait)
  330.   FREE(Queue:Browse)                              ! Free the browse queue
  331.   SET(CON:Date_Lead_Received)
  332.   Brw1::ItemsToFill = ?List{Prop:Items}           ! Load a full page
  333.   DO Brw1::FillBackward                           ! Fill with previous read(s)
  334.   SELECT(?List, RECORDS(Queue:Browse))            ! Select last list item
  335.   IF RECORDS(Queue:Browse) = ?List{Prop:Items}
  336.     Brw1::CurrentScroll = 100
  337.   ELSE
  338.     Brw1::CurrentScroll = 0
  339.   END
  340.   SETCURSOR()
  341. !----------------------------------------------------------------------
  342. Brw1::AlertKey ROUTINE
  343.   CASE KEYCODE()                                  ! What keycode was hit
  344.   OF MouseLeft2
  345.     IF LocalRequest = SelectRecord
  346.       POST(Event:Accepted,?Select)
  347.       EXIT
  348.     END
  349.     POST(Event:Accepted,?Change)
  350.     EXIT
  351.   OF InsertKey
  352.     POST(Event:Accepted,?Insert)
  353.   OF DeleteKey
  354.     POST(Event:Accepted,?Delete)
  355.   OF CtrlEnter
  356.     POST(Event:Accepted,?Change)
  357.   ELSE                                            ! ELSE (What keycode was hit)
  358.     IF CHR(KEYCHAR())
  359.       SET(CON:Date_Lead_Received)
  360.       CON:DateLead = CHR(KEYCHAR())
  361.       DO Brw1::LocateRecord                       ! Find the record
  362.     END
  363.   END                                             ! END (What keycode was hit)
  364. !----------------------------------------------------------------------
  365. Brw1::ValidateRecord ROUTINE
  366.   Brw1::RecordStatus = Record:OutOfRange
  367.   IF ERRORCODE() THEN EXIT.
  368.   Brw1::RecordStatus = Record:OK
  369.   EXIT
  370. !----------------------------------------------------------------------
  371. Brw1::FillForward ROUTINE
  372.   LOOP WHILE Brw1::ItemsToFill
  373.     NEXT(contacts)
  374.     DO Brw1::ValidateRecord
  375.     EXECUTE(Brw1::RecordStatus)
  376.       BEGIN
  377.         SET(CON:Date_Lead_Received)
  378.         BREAK
  379.       END
  380.       CYCLE
  381.     END
  382.     IF RECORDS(Queue:Browse) = ?List{Prop:Items}
  383.       GET(Queue:Browse,1)
  384.       DELETE(Queue:Browse)
  385.     END
  386.     Brw1::ItemsToFill -= 1
  387.     DO Brw1::FillQueue
  388.     ADD(Queue:Browse)
  389.   END
  390.   EXIT
  391. !----------------------------------------------------------------------
  392. Brw1::FillBackward ROUTINE
  393.   LOOP WHILE Brw1::ItemsToFill
  394.     PREVIOUS(contacts)
  395.     DO Brw1::ValidateRecord
  396.     EXECUTE(Brw1::RecordStatus)
  397.       BEGIN
  398.         SET(CON:Date_Lead_Received)
  399.         BREAK
  400.       END
  401.       CYCLE
  402.     END
  403.     IF RECORDS(Queue:Browse) = ?List{Prop:Items}
  404.       GET(Queue:Browse,RECORDS(Queue:Browse))
  405.       DELETE(Queue:Browse)
  406.     END
  407.     Brw1::ItemsToFill -= 1
  408.     DO Brw1::FillQueue
  409.     ADD(Queue:Browse,1)
  410.   END
  411.   EXIT
  412. !----------------------------------------------------------------------
  413. Brw1::LocateRecord ROUTINE
  414.   SETCURSOR(Cursor:Wait)
  415.   FREE(Queue:Browse)
  416.   SET(CON:Date_Lead_Received,CON:Date_Lead_Received)
  417.   Brw1::LocatedPosition = ''
  418.   LOOP
  419.     NEXT(contacts)
  420.     DO Brw1::ValidateRecord                           
  421.     EXECUTE(Brw1::RecordStatus)
  422.       BREAK
  423.       CYCLE
  424.     END
  425.     Brw1::LocatedPosition = POSITION(CON:Date_Lead_Received)
  426.     RESET(CON:Date_Lead_Received,Brw1::LocatedPosition)
  427.     BREAK
  428.   END
  429.   Brw1::ItemsToFill = ?List{Prop:Items}
  430.   Brw1::CurrentScroll = 50
  431.   DO Brw1::FillForward
  432.   IF Brw1::ItemsToFill
  433.     Brw1::CurrentScroll = 100
  434.     IF ~RECORDS(Queue:Browse)
  435.       SET(CON:Date_Lead_Received)
  436.     ELSE
  437.       GET(Queue:Browse,1)
  438.       RESET(CON:Date_Lead_Received,Brw1::Position)
  439.       PREVIOUS(contacts)
  440.     END
  441.     DO Brw1::FillBackward
  442.     IF Brw1::ItemsToFill
  443.       Brw1::CurrentScroll = 0
  444.     END
  445.   END
  446.   IF ~RECORDS(Queue:Browse)
  447.     CLEAR(CON:Record)
  448.     CLEAR(CON:Remarks)
  449.     SET(CON:Date_Lead_Received)
  450.     ?Change{Prop:Disable} = 1
  451.     ?Delete{Prop:Disable} = 1
  452.   ELSE
  453.     IF Brw1::LocatedPosition
  454.       Brw1::QueuePointer = 1
  455.       LOOP
  456.         GET(Queue:Browse,Brw1::QueuePointer)
  457.         IF ERRORCODE() THEN BREAK.
  458.         IF Brw1::Position = Brw1::LocatedPosition THEN BREAK.
  459.         Brw1::QueuePointer += 1
  460.       END
  461.     ELSE
  462.       Brw1::QueuePointer = RECORDS(Queue:Browse)
  463.     END
  464.     SELECT(?List,Brw1::QueuePointer)
  465.     DO Brw1::FillBuffer
  466.     REGET(CON:Date_Lead_Received,Brw1::Position)
  467.     ?Change{Prop:Disable} = 0
  468.     ?Delete{Prop:Disable} = 0
  469.   END
  470.   SETCURSOR()
  471. !----------------------------------------------------------------------
  472. Brw1::RefreshPage ROUTINE
  473.   SETCURSOR(Cursor:Wait)
  474.   IF RECORDS(Queue:Browse)
  475.     GET(Queue:Browse,1)
  476.     RESET(CON:Date_Lead_Received,Brw1::Position)
  477.     FREE(Queue:Browse)
  478.   END
  479.   Brw1::ItemsToFill = ?List{Prop:Items}
  480.   Brw1::CurrentScroll = 50
  481.   DO Brw1::FillForward
  482.   IF Brw1::ItemsToFill
  483.     GET(Queue:Browse,1)
  484.     RESET(CON:Date_Lead_Received,Brw1::Position)
  485.     PREVIOUS(contacts)
  486.     Brw1::CurrentScroll = 100
  487.     DO Brw1::FillBackward
  488.     IF Brw1::ItemsToFill
  489.       Brw1::CurrentScroll = 0
  490.     END
  491.   END
  492.   IF ~RECORDS(Queue:Browse)
  493.     CLEAR(CON:Record)
  494.     CLEAR(CON:Remarks)
  495.     SET(CON:Date_Lead_Received)
  496.     ?Change{Prop:Disable} = 1
  497.     ?Delete{Prop:Disable} = 1
  498.   ELSE
  499.     DO Brw1::FillBuffer
  500.     REGET(CON:Date_Lead_Received,Brw1::Position)
  501.     ?Change{Prop:Disable} = 0
  502.     ?Delete{Prop:Disable} = 0
  503.   END
  504.   SETCURSOR()
  505. !----------------------------------------------------------------
  506. Brw1::ButtonInsert ROUTINE
  507.   GET(contacts,0)
  508.   CLEAR(CON:Record,0)
  509.   CLEAR(CON:Remarks)
  510.   SET(CON:Date_Lead_Received)
  511.   GlobalRequest = InsertRecord
  512.   UpdateProc
  513.   IF GlobalResponse = RequestCompleted
  514.     DO Brw1::ValidateRecord
  515.     IF Brw1::RecordStatus = Record:OK
  516.       DO Brw1::LocateRecord
  517.     END
  518.   END
  519.   ForceRefresh = True
  520.   LocalRequest = OriginalRequest
  521. !----------------------------------------------------------------
  522. Brw1::ButtonChange ROUTINE
  523.   GlobalRequest = ChangeRecord
  524.   UpdateProc
  525.   IF GlobalResponse = RequestCompleted
  526.     DO Brw1::ValidateRecord
  527.     IF Brw1::RecordStatus = Record:OK
  528.       DO Brw1::LocateRecord
  529.     ELSE
  530.       SELECT(?List,CHOICE(?List))
  531.     END
  532.   END
  533.   ForceRefresh = True
  534.   LocalRequest = OriginalRequest
  535. !----------------------------------------------------------------
  536. Brw1::ButtonDelete ROUTINE
  537.   GlobalRequest = DeleteRecord
  538.   UpdateProc
  539.   IF GlobalResponse = RequestCompleted
  540.     DELETE(Queue:Browse)
  541.     DO Brw1::RefreshPage
  542.   END
  543.   SELECT(?List,CHOICE(?List))
  544.   ForceRefresh = True
  545.   LocalRequest = OriginalRequest
  546.  
  547.